-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Moved imports into functions that use them #9722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I've tested this change and successfully pulled data from and pushed to GBQ with it. |
_GOOGLE_FLAGS_INSTALLED = True | ||
|
||
_GOOGLE_FLAGS_VERSION = pkg_resources.get_distribution('python-gflags').version | ||
if compat.PY3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be moved into a function as this will raise on import of pandas when under py3.
@jreback good point. I've moved the Python3 check into the function that checks for compatibility with the google API |
|
cc @jacobschaer can you give a test out pls. |
Rebase done and release note added. |
@cgrin the |
@jreback Looks like it's called in the test suite. Since the |
We could also bring that function into test_gbq.py, removing the imports that are no longer necessary. |
you can change the tests. The idea is to have a series of tests:
|
Thanks. I opted to move this function into the test suite and remove the no longer needed imports. (Also rebased again as there has been some movement on the upstream repo). Hopefully this gets us where we need to be! |
Looks like I missed a couple imports there. Apologies, I'm having issues getting the tests to run at all locally. 686ee7e should fix the compatibility tests. |
commit 3d6fdc8751134f6e5bac700519358cf9a700aba1 Author: Chris Grinolds <[email protected]> Date: Wed Apr 29 21:43:10 2015 -0700 Added missing imports that caused tests to fail commit 6c345d8dbc0c36bd4369dd220eceb495ab5ff2c6 Author: Chris Grinolds <[email protected]> Date: Wed Apr 29 16:23:01 2015 -0700 Updated test suite to handle changes to gbq.py commit f43e65f924d07f88bbbe308b9ea396b1f2a720f9 Author: Chris Grinolds <[email protected]> Date: Wed Apr 29 08:46:00 2015 -0700 Updated BigQuery connector to no longer use deprecated ```oauth2client.tools.run() (#8327) commit ea92e200ff341a3025b06868a565b1eea506c4c2 Author: Chris Grinolds <[email protected]> Date: Wed Apr 29 08:43:43 2015 -0700 Import BigQuery dependencies on a per-method basis (#9713)
Rebased one more time and squashed everything. Regarding #8327, the |
merged via 2cf4132 thanks! |
closes #9713
closes #8327
Changes to be committed:
modified: pandas/io/gbq.py
Moved google api imports into functions that call them, removed unused imports. This fixes #9713